Bee.form.ArrayComboBox = Ext.extend(Ext.form.ComboBox, {
    editable: false,
    typeAhead: false,
    triggerAction: 'all',
    selectOnFocus: true,
    mode: 'local',
    width: 100,
    valueField: 'key',
    displayField: 'label',
    resizable: true,
    initComponent: function(){
        if (this.ds instanceof Ext.data.Store) {
            this.store = this.ds;
            delete this.ds;
        }
        else 
            if (this.ds.call) {
                this.store = new Bee.data.DWRStore({
                    dwr: {
                        call: this.ds.call,
                        params: this.ds.params
                    },
                    listeners: this.ds.listeners || null,
                    fields: this.ds.fields ||
                    ['key', 'label'],
                    defaultItems: this.defaultItems
                });
                delete this.ds;
            }
            else {
                this.store = new Ext.data.SimpleStore({
                    data: this.ds.data,
                    fields: this.ds.fields ||
                    ['key', 'label']
                });
                delete this.ds;
            }
        Bee.form.ArrayComboBox.superclass.initComponent.call(this);
    }
});

Ext.reg('acombo', Bee.form.ArrayComboBox);
